#include <stdio.h>
#include <string.h>
#define MAX_STR 1024

//暴力破解   写三个for循环 两个遍历字符串 一个确定子串长度
int main(int argc, char const *argv[])
{
    char str1[MAX_STR] = {0};
    char str2[MAX_STR] = {0};
    int max_len = 0, maxTmp = 0;

    scanf("%s\n%s", str1, str2);

    int n = strlen(str1);
    int m = strlen(str2);

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {

            int a = i, b = j; //定义相等字符位置的坐标
            while (str1[a]==str2[b] && a < n && b < m)
            {
                a++;#include <stdio.h>
#include <string.h>
#define MAX_STR 1024

//暴力破解   写三个for循环 两个遍历字符串 一个确定子串长度
int main(int argc, char const *argv[])
{
    char str1[MAX_STR] = {0};
    char str2[MAX_STR] = {0};
    int max_len = 0, maxTmp = 0;

    scanf("%s\n%s", str1, str2);

    int n = strlen(str1);
    int m = strlen(str2);

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {

            int a = i, b = j; //定义相等字符位置的坐标
            while (str1[a]==str2[b] && a < n && b < m)
            {
                a++;
                b++;
                maxTmp++;
            }
            if (maxTmp > max_len)
            {
                max_len = maxTmp;
            }
            maxTmp = 0;
        }
    }

    printf("%d\n", max_len);

    return 0;
}
#include <stdio.h>
#include <string.h>
#define MAX_STR 1024

//暴力破解   写三个for循环 两个遍历字符串 一个确定子串长度
int main(int argc, char const *argv[])
{
    char str1[MAX_STR] = {0};
    char str2[MAX_STR] = {0};
    int max_len = 0, maxTmp = 0;

    scanf("%s\n%s", str1, str2);

    int n = strlen(str1);
    int m = strlen(str2);

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {

            int a = i, b = j; //定义相等字符位置的坐标
            while (str1[a]==str2[b] && a < n && b < m)
            {
                a++;
                b++;
                maxTmp++;
            }
            if (maxTmp > max_len)
            {
                max_len = maxTmp;
            }
            maxTmp = 0;
        }
    }

    printf("%d\n", max_len);

    return 0;
}

                b++;
                maxTmp++;
            }
            if (maxTmp > max_len)
            {
                max_len = maxTmp;
            }
            maxTmp = 0;
        }
    }

    printf("%d\n", max_len);

    return 0;
}
